using System;
using OrdersManager.Infrastructure.Interface;
using OrdersManager.Module;
using OrdersManager.Module.BusinessEntities;
using OrdersManager.Module.Constants;
using OrdersManager.Module.Services;

namespace OrdersManager.Module.Tests.Mocks
{
	public class MockOrderPollingService : IOrderPollingService
	{
		public event EventHandler<EventArgs<OrderCollection>> OrdersLoadedEvent;

		private int _interval;
        //private bool _started;
        //private bool _stopped;
        private OrderStatus _mode = OrderStatus.Initial;

        public OrderStatus Mode
        {
            get 
            { 
                return _mode; 
            }
            set 
            { 
                _mode = value; 
            }
        }

		public int Interval
		{
			get 
            { 
                return _interval; 
            }
			set 
            { 
                _interval = value; 
            }
		}

		public void Start()
		{
			Start(5000);
		}

		public void Start(int interval)
		{
			_interval = interval;
            //_started = true;

			if (OrdersLoadedEvent != null)
				OrdersLoadedEvent(this, new EventArgs<OrderCollection>(new OrderCollection()));
		}

		public void Stop()
		{
            //_stopped = true;
		}
	}
}